const genSetting = (data) => {
  const userCenterHomeUrl = `/learn/home/index.html`
  const logoutUrl = `/learn/auth/login`
  const studentWebUrl = `/learn/program-center/student/index.html#`
  const tutorWebUrl = `/learn/program-center/tutor/index.html#`
  const quizWebUrl = `/learn/quiz-center/`
  const instructorWebUrl = `/learn/program-center/instructor/index.html#`
  const programCenterUrl = `/learn/program-center`
  const notificationMoreUrl = `/learn/notification-center/index.html`

  return Object.assign({}, {
    userCenterHomeUrl,
    logoutUrl,
    studentWebUrl,
    quizWebUrl,
    tutorWebUrl,
    instructorWebUrl,
    programCenterUrl,
    notificationMoreUrl
  }, data)
}

export default (state = {}, action) => {
  switch (action.type) {
    case 'GET_SETTINGS':
      return genSetting(action.data)
    default:
      return state
  }
}
